package com.xiyuan.smartutils.exceptions;

import com.xiyuan.smartutils.StrUtils;

/**
 * 工具类异常
 *
 * @author xiyuan-lgz 2024-07-20 @version v1.0.0 新建与整理
 */
public class UtilException extends RuntimeException {
    
    public UtilException(Throwable e) {
        super(e.getMessage(), e);
    }
    
    public UtilException(String message) {
        super(message);
    }
    
    public UtilException(String messageTemplate, Object... params) {
        super(StrUtils.format(messageTemplate, params));
    }
    
    public UtilException(String message, Throwable throwable) {
        super(message, throwable);
    }
    
    public UtilException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
        super(message, throwable, enableSuppression, writableStackTrace);
    }
    
    public UtilException(Throwable throwable, String messageTemplate, Object... params) {
        super(StrUtils.format(messageTemplate, params), throwable);
    }
}
